#! /bin/bash
export LANG=zh_CN.UTF-8
HIVE_HOME=/usr/bin/hive	

${HIVE_HOME} -S -e "
create database if not exists view_consult_dwb;


drop table view_consult_dwb.dwb_view_consult;
create table view_consult_dwb.dwb_view_consult(
id                           INT,
session_id                   STRING COMMENT '七陌sessionId',
sid                          STRING COMMENT '访客id',
create_time                  STRING COMMENT '会话创建时间',
seo_source                   STRING COMMENT '搜索来源',
ip                           STRING COMMENT 'IP地址',
area                         STRING COMMENT '地域',
country                      STRING COMMENT '所在国家',
province                     STRING COMMENT '省',
city                         STRING COMMENT '城市',
origin_channel               STRING COMMENT '投放渠道',
from_url             STRING COMMENT '会话来源页面',
msg_count                    INT COMMENT '客户发送消息数',
yearinfo                      STRING COMMENT '年',
monthinfo                        STRING COMMENT '月',
dayinfo                    STRING COMMENT '日',
quarterinfo                     STRING COMMENT '季度'


)comment '访问与咨询信息表'
row FORMAT DELIMITED FIELDS TERMINATED BY '\t'
STORED AS orc TBLPROPERTIES ('orc.compress'='SNAPPY');



"